package com.yao2san.dbdif.controller;

import com.yao2san.dbdif.service.DbDifService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

@Controller
public class DbDifController {
    @Autowired
    private DbDifService dbDifService;

    @GetMapping({"/", ""})
    public String home() {
        return "home";
    }

    @PostMapping("qryTables")
    @ResponseBody
    public List<Map<String, Object>> qryTables(@RequestBody  Map<String, Object> params) {
        return dbDifService.qryTables(params);
    }
    @PostMapping("qryFields")
    @ResponseBody
    public List<Map<String, Object>> qryFields(@RequestBody  Map<String, Object> params) {
        return dbDifService.qryFields(params);
    }
}
